// ntpclient.h
#pragma once
#include <QObject>
#include <QUdpSocket>
#include <QDateTime>

class NtpClient : public QObject {
    Q_OBJECT
public:
    explicit NtpClient(QObject *parent = nullptr);
    void requestTime();

signals:
    void timeUpdated(const QDateTime &datetime);

private slots:
    void readPendingDatagrams();

private:
    QUdpSocket *socket;
};
